﻿#parse("partials/header.html") #parse("partials/sidebar.html")
<script type="text/javascript">
    $(document).ready(function () {
        jQuery(".deleteconfirm").live('click', function (event) {
            var deleteid = $(this).attr("deleteid");
            DeleteConfirm(deleteid);
        });

        function DeleteConfirm(id) {
            $("#dialog-confirm").dialog({
                resizable: false,
                height: 160,
                modal: true,
                buttons: {
                    "Yes": function () {
                        jQuery.ajax({
                            type: "GET",
                            url: "/master/itemdata/deleteitemdata/?id=" + id,
                            cache: false,
                            success: function (data) {
                                oTable.fnDraw();
                            },
                            error: function (data) {
                            },
                            complete: function () {
                            }
                        });
                        $(this).dialog("close");
                    },
                    Cancel: function () {
                        $(this).dialog("close");
                    }
                }
            });
        }

        var oTable = $('#datalist').dataTable({
            "bSort": false,
            "sPaginationType": "full_numbers",
            "bProcessing": false,
            "bServerSide": true,
            "sAjaxSource": "/master/itemdata/tablelist",
            "aoColumns": [
                            { "mDataProp": "Id" },
                            { "mDataProp": "CodeValue" },
                             { "mDataProp": "NameValue" }
                        ],
            "aoColumnDefs": [
                                {
                                    "fnRender": function (o) {
                                        return "<center><a class='tooltip' title='Edit Record' href='/master/itemdata/edititemdata/?id=" + o.aData['Id'] + "' ><img src='/images/Icons/pencil.png'/></a><a class='deleteconfirm' style='cursor:pointer' title='Delete Record' deleteid='" + o.aData['Id'] + "'><img src='/images/Icons/eraser.png'/></a></center>";
                                    },
                                    "aTargets": [0]
                                }
                        ],
            "fnServerData": function (sSource, aoData, fnCallback) {
                aoData.push({ "name": "itemcode", "value": $('#itemcode').val() });
                aoData.push({ "name": "itemname", "value": $('#itemname').val() });
                jQuery.ajax({
                    "dataType": 'json',
                    "type": "GET",
                    "url": rooturl + "master/itemdata/tablelist",
                    "data": aoData,
                    "success": fnCallback
                });
            }

        }).fnSetFilteringPressEnter();

        function checkForEnter(event) {
            if (event.keyCode == 13) {
                oTable.fnDraw();
            }
        }

        $('#itemcode').keypress(checkForEnter);
        $('#itemname').keypress(checkForEnter);
        $('#buttonSearch').click(function () { oTable.fnDraw(); });

    });
</script>
<div id="dialog-confirm" title="Delete Confirmation" style="display: none">
    <p>
    </p>
    <p>
        <span class="ui-icon ui-icon-alert" style="float: left; margin: 5px 7px 20px 40px;">
        </span>Are you sure want to delete this record?</p>
</div>
<style>
    div#datalist_filter 
    {
        display:none;
    }
    div#datalist_length 
    {
        display:none;
    }
    .mws-table thead 
    {
        margin-top:-10px;
    }
</style>
<div id="mws-container" class="clearfix">
    <div class="container">
        <div class="mws-panel grid_8">
            <div class="mws-panel-header">
                <span class="mws-i-24 i-table-1">$Pagetitle</span>
            </div>
            <div class="mws-panel-body">
                <div class="mws-panel-toolbar top clearfix">
                    <ul>
                        <li><a class="mws-ic-16 ic-application-view-list" href="/master/itemdata/index/" title="Accept">Item Data List</a></li>
                           <li><a class="mws-ic-16 ic-application-view-list" href="/master/itemcategory/index/" title="Accept">Item Category List</a></li>
                            <li><a class="mws-ic-16 ic-application-view-list" href="/master/itemgroups/index/" title="Accept">Item Groups List</a></li>
                           <li><a class="mws-ic-16 ic-application-view-list" href="/master/itemshapes/index/" title="Accept">Item Shapes List </a></li>
                              <li><a class="mws-ic-16 ic-application-view-list" href="/master/itemtypes/index/" title="Accept">Item Types List</a></li>
                   
                    </ul>
               
                </div>
          
            </div>
        </div>
      <!--  <hr />-->
    </div>
#parse("partials/footer.html") 